home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cxl400.arc / CXLVID.H < prev    next >
C/C++ Source or Header  |  1988-11-19  |  5KB  |  135 lines

  1.  
  2. /*
  3.    ┌──────────────────────────────────────────────────────────────────────────┐
  4.    │                                                                          │
  5.    │  CXLVID.H - CXL (c) 1987, 1988 by Mike Smedley.                          │
  6.    │                                                                          │
  7.    │  This header file contains function prototypes and definitions for       │
  8.    │  screen/video functions.  Windowing functions are defined in CXLWIN.H    │
  9.    │                                                                          │
  10.    └──────────────────────────────────────────────────────────────────────────┘
  11. */
  12.  
  13.  
  14. #if defined(__TURBOC__)
  15.     #if __STDC__
  16.         #define _Cdecl
  17.     #else
  18.         #define _Cdecl  cdecl
  19.     #endif
  20.     #define _Near
  21. #elif defined(__ZTC__)
  22.     #define _Cdecl
  23.     #define _Near
  24. #elif defined(M_I86) && !defined(__ZTC__)
  25.     #if !defined(NO_EXT_KEYS)
  26.         #define _Cdecl  cdecl
  27.         #define _Near   near
  28.     #else
  29.         #define _Cdecl
  30.         #define _Near
  31.     #endif
  32. #endif
  33.  
  34.  
  35. /*---------------------------[ Function Prototypes ]-------------------------*/
  36.  
  37. void     _Cdecl box_(int srow,int scol,int erow,int ecol,int btype,int atr);
  38. void     _Cdecl boxd(int srow,int scol,int erow,int ecol,int btype,int atr);
  39. void     _Cdecl clreol_(void);
  40. void     _Cdecl clrscrn(void);
  41. int      _Cdecl disktoscrn(char *fname);
  42. void     _Cdecl fill_(int srow,int scol,int erow,int ecol,int ch,int atr);
  43. void     _Cdecl filld(int srow,int scol,int erow,int ecol,int ch,int atr);
  44. void     _Cdecl gotoxy_(int row,int col);
  45. void     _Cdecl mode(int mode_code);
  46. void     _Cdecl printc(int row,int col,int attr,int ch,int count);
  47. void     _Cdecl printcd(int row,int col,int attr,int ch);
  48. void     _Cdecl prints(int row,int col,int attr,char *str);
  49. void     _Cdecl printsd(int row,int col,int attr,char *str);
  50. unsigned _Cdecl readchat(void);
  51. void     _Cdecl readcur(int *row,int *col);
  52. void     _Cdecl revattr(int count);
  53. int      _Cdecl scrntodisk(char *fname);
  54. void     _Cdecl setattr(int attr,int count);
  55. void     _Cdecl setcursz(int sline,int eline);
  56. int      _Cdecl setlines(int numlines);
  57. void     _Cdecl spc(int num);
  58. void     _Cdecl srestore(int *sbuf);
  59. int     *_Cdecl ssave(void);
  60. void     _Cdecl videoinit(void);
  61. int      _Cdecl vidtype(void);
  62. void     _Cdecl waitvret(void);
  63.  
  64.  
  65. /*-------------[ display adapter types returned from vidtype() ]-------------*/
  66.  
  67. #define MDA         0
  68. #define HGC         1
  69. #define HGCPLUS     2
  70. #define INCOLOR     3
  71. #define CGA         4
  72. #define EGA         5
  73. #define VGA         6
  74.  
  75.  
  76. /*-----------------------[ video RAM segment address ]-----------------------*/
  77.  
  78. extern unsigned _Near _Cdecl _videoseg;
  79. extern int      _Near _Cdecl _cgasnow;
  80.  
  81.  
  82. /*--------------[ attribute codes for functions that use them ]--------------*/
  83.  
  84.     /*  attribute codes are created by ORing the codes for foreground
  85.         color, background color, and optionally blink, together.  For
  86.         example, to create an attribute code for light blue on green,
  87.         you would use LBLUE|_GREEN and to make the foreground blink,
  88.         you would add |BLINK onto the end of that.                      */
  89.  
  90. #if     !defined(BLACK)                 /*  foreground colors  */
  91. #define BLACK       0                   
  92. #define BLUE        1
  93. #define GREEN       2
  94. #define CYAN        3
  95. #define RED         4
  96. #define MAGENTA     5
  97. #define BROWN       6
  98. #define YELLOW      14
  99. #define WHITE       15
  100. #endif
  101. #if     !defined(LGREY)
  102. #define LGREY       7                   /*  CXL abbreviates LIGHT as L     */
  103. #define DGREY       8                   /*  and DARK as D for ease of use  */
  104. #define LBLUE       9
  105. #define LGREEN      10
  106. #define LCYAN       11
  107. #define LRED        12
  108. #define LMAGENTA    13
  109.  
  110. #define _BLACK      0                   /*  background colors  */
  111. #define _BLUE       16
  112. #define _GREEN      32
  113. #define _CYAN       48
  114. #define _RED        64
  115. #define _MAGENTA    80
  116. #define _BROWN      96
  117. #define _LGREY      112
  118.  
  119. #define BLINK       128                 /*  blink attribute  */
  120. #endif
  121.  
  122.  
  123. /*-----------------------[ Macro-Function Definitions ]----------------------*/
  124.  
  125. #if !defined(MK_FP)
  126. #define MK_FP(seg,ofs)      ((void far *) (((unsigned long)(seg) << 16) | \
  127.                             (unsigned)(ofs)))
  128. #endif
  129. #if !defined(attrib)
  130. #define attrib(f,b,i,bl)    ((b<<4)|(f)|(i<<3)|(bl<<7))
  131. #endif
  132. #if !defined(clrwin)
  133. #define clrwin(a,b,c,d)     gotoxy_(a,b);fill_(a,b,c,d,' ',(readchat()>>8))
  134. #endif
  135.